 target="_blank"<template>
  <div class="team-desc">
    <div>
      <van-nav-bar
        title="Team description"
        left-arrow
        @click-left="$router.back()"
      />
    </div>
    <div class="desc-bg"></div>
    <div class="desc-card">
      <p class="card-title">
        {{ invite_url }}
      </p>
      <button v-clipboard:copy="copyInfo" v-clipboard:success="copy">
        Copy Invitation Link
      </button>
      <div>
        <van-divider class="toShare">To share</van-divider>
      </div>
      <ul>
        <li>
          <a href="https://api.whatsapp.com/" target="_blank">
            <img src="../../assets/imgs/share_phone.png" alt="" srcset="" />
          </a>
        </li>
        <li>
          <a href="https://t.me/@" target="_blank">
            <img src="../../assets/imgs/share_face.png" alt="" srcset="" />
          </a>
        </li>
        <li>
          <a href="https://www.facebook.com/" target="_blank">
            <img src="../../assets/imgs/share_f.png" alt="" srcset="" />
          </a>
        </li>
        <li>
          <a href="http://instagram.com/" target="_blank">
            <img src="../../assets/imgs/share_4.png" alt="" srcset="" />
          </a>
        </li>
      </ul>
    </div>
    <div class="desc-content">
      <h3>Team description</h3>
      <div class="box" v-html="content"></div>
    </div>
  </div>
</template>
<script>
import { Toast } from "vant";
import { getStorage } from "@/utils/common";
export default {
  data() {
    return {
      content: "",
      copyInfo: "",
      invite_url: "",
    };
  },
  mounted() {
    this.$store.dispatch("getperons").then((res) => {
      // let persons = JSON.parse(getCookie(" perons"));
      let persons = JSON.parse(getStorage("infpo"));
      this.copyInfo = persons.invite_desc + persons.invite_url;
      this.invite_url = persons.invite_url;
    });  
    this.$store
      .dispatch("articlesdes", { key: "TeansDescription" })
      .then((res) => {
        this.content = res.content;
      });

  },
  methods: {
    copy(e) {
      this.$toast("Copy succeeded");
    },
  },
};
</script>
<style lang="scss" scoped>
.team-desc {
  height: 100%;
  .desc-bg {
    width: 100%;
    height: 363px;
    background: url("../../assets/imgs/teamdesc_bg.png");
    background-size: contain;
  }
  .desc-card {
    margin: -139px auto 0 auto;
    width: 346px;
    height: 270px;
    background: #ffffff;
    box-shadow: 0px 4px 9px rgba(0, 0, 0, 0.08);
    opacity: 1;
    border-radius: 10px;
    box-sizing: border-box;
    padding: 30px 0;
    text-align: center;

    .card-title {
      width: 340px;
      margin: 0 auto 15px auto;
      font-size: 17px;
      text-align: center;
      color: #313131;
      word-break: break-all;
    }
    .toShare {
      color: #4a67f5;
    }
    button {
      width: 300px;
      height: 50px;
      border: none;
      background: #4a67f5;
      box-shadow: 0px 2px 4px rgba(78, 105, 236, 0.6);
      border-radius: 105px;
      font-size: 17px;
      color: #fff;
    }
    ul {
      display: flex;
      justify-content: space-evenly;
    }
    ul > li {
      img {
        width: 49px;
        height: 50px;
      }
    }
  }
  .desc-content {
    margin: 14px;
    background-color: #fff;
    border-radius: 10px;
    h3 {
      text-align: center;
      padding: 20px;
      font-size: 18px;
      color: #4a67f5;
    }
    .box {
      padding: 10px;
    }
  }
}
</style>